*  Redux DMDC Survey 
cd "\\facaa7pde01p\PDE\Projects\PDE-FINPEEREFFECT"

use dmdc_data, clear
*drop non-respondents
keep if inlist(xcsbtaker, 1, 2)

svyset random [pweight=finalwgt], strata(strat) fpc(nstrat)

gen female=(sex=="F")
gen white=(racer==1)
gen educ_hs_to_almostaa=inrange(educ, 21,41)
gen educ_aa_to_almostba=inrange(educ, 44, 45)
gen educ_ba=(educ==51)
gen educ_ma_above=inrange(educ, 61, 64)

gen married=(mrtl_sta=="M")
gen took_redux=(paymentype==7)

gen army=(svc=="A")
gen airforce=(svc=="F")
gen usmc=(svc=="M")
gen navy=(svc=="N")

keep if navy==1

gen enlisted=(inlist(takerpg, 1, 2))
gen officer=(inlist(takerpg, 3, 4))

rename deps dependents

*saving habit
* 0: don't save/whatever is left 1: save according to plan
gen saving_habit=(qcba010==5)

*financial condition
* 0: occasionally - often cannot make ends meet 1: comfortable
gen fin_condition=(inlist(qcba011, 1, 2))

gen redux_combat=(qcba024==2)
gen redux_regret=(qcba025==1)

gen redux_took=(xcsbtaker==1)

gen redux_know_20yr=(qcba020ar==2)
gen redux_know_30yr=(qcba020br==2)
gen redux_know_cpi=(qcba020cr==2)
gen redux_know_age62=(qcba020dr==2)

gen redux_use_debt=(qcba022ar==2)
gen redux_use_invest=(qcba022br==2)
gen redux_use_homedp=(qcba022cr==2)
gen redux_use_college=(qcba022dr==2)
gen redux_use_carboat=(qcba022er==2)
gen redux_use_business=(qcba022fr==2)

keep female white educ_* redux_* fin* navy enlisted officer married redux_took married dependents saving* age mil_lgv_pay random finalwgt strat nstrat

gen agesq=age^2

gen yrs_since_redux=mil_lgv_pay-14.5
gen yrs_since_reduxsq=yrs_since_redux^2
gen age_at_redux=age-yrs_since_redux
gen age_at_reduxsq=age_at_redux^2

log using finpeer_log_surveywgt_122123, replace

* LACK OF KNOWLEDGE ABOUT REDUX
* 40.1% of Redux-takers do not know at least 1 major element of program
* 28.7% of Redux-takers do not know about the CPI penalty
count if redux_took==1&navy==1
count if redux_took==1& redux_know_20yr==1& redux_know_30yr==1& redux_know_cpi==1& redux_know_age62==1&navy==1
count if redux_took==1&  redux_know_cpi==0 &navy==1

*Appendix Table D.7

* summary stats for whole sample 
svy: mean redux_took female white married dependents educ_ba educ_ma_above age_at_redux yrs_since_redux enlisted redux_combat saving_habit fin_condition  redux_regret  saving_habit redux_know_20yr redux_know_30yr redux_know_cpi redux_know_age62 redux_use_debt redux_use_invest redux_use_homedp redux_use_college redux_use_carboat redux_use_business if navy==1
*generate standard deviation
estat sd

*summary stats for Redux takers
svy: mean redux_took female white married dependents educ_ba educ_ma_above age_at_redux yrs_since_redux enlisted redux_combat saving_habit fin_condition  redux_regret  saving_habit redux_know_20yr redux_know_30yr redux_know_cpi redux_know_age62 redux_use_debt redux_use_invest redux_use_homedp redux_use_college redux_use_carboat redux_use_business if redux_took==1&navy==1
estat sd

*summary stats for High-3 takers
svy: mean redux_took female white married dependents educ_ba educ_ma_above age_at_redux yrs_since_redux enlisted redux_combat saving_habit fin_condition   redux_regret  saving_habit redux_know_20yr redux_know_30yr redux_know_cpi redux_know_age62 redux_use_debt redux_use_invest redux_use_homedp redux_use_college redux_use_carboat redux_use_business if redux_took==0&navy==1
estat sd

* Appendix Table D.8
*likelihood of taking redux - strongly positively correlated with bad savings habits and being deployed overseas for combat duty, strongly negatively correlated with higher education and knowing esp. about the CPI penalty
svy: reg redux_took female white married dependents educ_ba educ_ma_above age_at_redux yrs_since_redux enlisted redux_combat saving_habit fin_condition    redux_know_20yr redux_know_30yr redux_know_cpi redux_know_age62 if navy==1

* Appendix Table D.9
*regret for Redux users who use funding for various reasons - only those who use it to invest are substantively less likely to regret 
*robust to including other controls:
reg redux_regret female white married dependents educ_ba educ_ma_above age_at_redux yrs_since_redux enlisted redux_combat saving_habit fin_condition    redux_know_20yr redux_know_30yr redux_know_cpi redux_know_age62 redux_use_debt redux_use_invest redux_use_homedp redux_use_college redux_use_carboat redux_use_business if redux_took==1&navy==1

log close

